<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="row">
	<div class="col-lg-10 offset-lg-1">
		<div class="card">
			<div class="card-body">
				<form action="<?php echo url("plugin-setting-sky_thumb_list");?>" method="post" id="form">
					<h4 class="card-title">插件设置</h4>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">缩略图尺寸：</label>
						<div class="col-sm-10">
							宽：<input type="number" style="width: 80px;" name="thumb_w" value="<?php echo $thumb_w;?>" />
							高：<input type="number" style="width: 80px;" name="thumb_h" value="<?php echo $thumb_h;?>" />
							<span style="color: #999;">不填写将使用默认原图</span>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">图片列表：</label>
						<div class="col-sm-10">
							<div class="form-check form-check-inline">
								<?php if($forums){ foreach($forums as $val) {?>
								<label><input type="checkbox" <?php if(isset($sky_thumb_list_fid_checked[$val['fid']])){?>checked<?php }?> class="form-check-input" value="<?php echo $val['fid'];?>" name="sky_thumb_list_fid[]" /><?php echo $val['name'];?></label>
								<?php }}?>
							</div>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">图文列表：</label>
						<div class="col-sm-10">
							<div class="form-check form-check-inline">
								<?php if($forums){ foreach($forums as $val) {?>
									<label><input type="checkbox" <?php if(isset($sky_txt_thumb_list_fid_checked[$val['fid']])){?>checked<?php }?> class="form-check-input" value="<?php echo $val['fid'];?>" name="sky_txt_thumb_list_fid[]" /><?php echo $val['name'];?></label>
								<?php }}?>
							</div>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label"></label>
						<div class="col-sm-10">
							<button type="submit" class="btn btn-primary btn-block" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('confirm');?></button>
							<a role="button" class="btn btn-secondary btn-block m-t-1" href="javascript:history.back();"><?php echo lang('back');?></a>
						</div>
					</div>
				</form>
				<p class="m-a-1 small"><strong>提示：</strong>请不要重复设置，图片列表优先级大于图文列表</p>
			</div>
		</div>
	</div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>
var jform = $("#form");
var jsubmit = $("#submit");
var referer = '<?php echo http_referer();?>';
jform.on('submit', function(){
	jform.reset();
	jsubmit.button('loading');
    var postdata = jform.serialize();
	$.xpost(jform.attr('action'), postdata, function(code, message) {
		if(code == 0) {
			$.alert(message);
			jsubmit.text(message).delay(2000).button('reset').location(referer);
			return;
		} else {
			$.alert(message);
			jsubmit.button('reset');
		}
	});
	return false;
});
</script>